
<?php
session_start();

// 检查用户是否登录
if (!isset($_SESSION['userid'])) {
    header('Location: login.php');
    exit();
}

// 检查用户的权限等级
if ($_SESSION['role'] != 'user') {
    header('Location: ../admin/admin.php');
    exit();
}

// 显示普通用户功能
echo '欢迎用户' . $_SESSION['username'];
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>资产管理系统</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body {
            position: relative;
        }
        .header {
            position: fixed;
            top: 0;
            /*bottom: 0;*/
            left: 0;
            right: 0;
            width： 100%;
            height: 50px;
            background-color: #23262E;
        }
        .logo img{
            display: block;
            float: left;
            width: 200px;
            height: 45px;
            margin-top: 3px;
            margin-left: 40px;
        }
        .zi {
            padding-top: 3px;
            text-align: center;
            font-size: 30px;
            color: white;
        }
        .menu {
            position: fixed;
            top: 50px;
            bottom: 0;
            left: 0;
            /*right: 0;*/
            width: 200px;
            background-color: #23262E;
        }
        .menu_head {
            width： 100%;
            height: 40px;
            font-size: 25px;
            line-height: 40px;
            text-align: center;
            color: white;
            background-color: #2E2D3C;
        }
        .menu a {
            display: block;
            width： 100%;
            height: 35px;
            line-height: 35px;
            text-align: center;
            font-size: 16px;
            color: white;
            text-decoration: none;
        }
        .menu a:hover {
            background-color: #575757;
        }

        .main{
            margin-left: 200px;
            margin-top: 50px;
            background-color: white;
            width: calc(100% - 200px);
            height: calc(100vh - 50px - 10px);
        }
        .main .content {
            width: 100%;
            height: 100%;
            border: 0;
        }
    </style>
</head>

<body>
<div class="header">
    <div class="logo">
        <a href="../login.php"><img src="../photo/logo1.jpg" alt="LOGO"></a>
    </div>
    <div class="zi">
        资产管理系统
    </div>
</div>

<div class="menu">
    <div class="menu_head">设备查询</div>
    <a href="../select/selectall.php" target="dd">显示所有的设备</a>
    <a href="../select/selectsn1.php" target="dd">按序列号查询</a>
    <a href="../select/selecteverythink1.php" target="dd">单字段查询</a>
    <a href="../select/selectevery1.php" target="dd">多字段查询</a>

    <div class="menu_head">设备管理</div>
    <a href="../insert/hostinsert1.php" target="dd">设备新增</a>
    <a href="../update/selecthost1.php" target="dd">设备修改删除</a>
    <a href="../insert/ziduan1.php" target="dd">设备字段维护</a>
    <a href="../insert/csvupload.php" target="dd">批 量 导 入</a>
    <a href="../insert/download.php" target="dd">批 量 导 出</a>

</div>

<div class="main">
    <iframe src="../info.php" class="content" name="dd"></iframe>
</div>
</body>
</html>